package com.module.antiFake.schedule;

import java.util.Timer;

import com.module.antiFake.schedule.task.AntiFakeWarnTask;

/**
 * 防伪定时扫描器;
 * @author wult
 *
 */
public class AntiFakeWarnSchedule {
	private static AntiFakeWarnSchedule schedule;
	
	private Timer timer;

	public AntiFakeWarnSchedule() {
	}
	
	public static AntiFakeWarnSchedule getInstance(){
		if(schedule == null){
			schedule = new AntiFakeWarnSchedule();
		}
		return schedule;
	}
	

	/**
	 * 开始执行定时器;
	 * @param delaySecond		
	 * @param intervalSecond	
	 */
	public void start(int delaySecond,int intervalSecond){
		if(timer == null){
			timer = new Timer();
			timer.schedule(new AntiFakeWarnTask(), delaySecond*1000,intervalSecond*1000);
		}
	}
}
